<template>
  <view>
    <view class="flex items-center justify-around bg-white pl-30 pr-20 pb-30">
      <view class="mr-10">
        <u-avatar
          src="https://uviewui.com/common/logo.png"
          size="140"></u-avatar>
      </view>
      <view class="flex-1">
        <view class="text-36 pb-20">uview plus</view>
        <view class="text-28 u-tips-color">微信号:test</view>
      </view>
      <view class="ml-10 p-10">
        <u-icon name="scan" color="#969799" size="28"></u-icon>
      </view>
      <view class="ml-10 p-10">
        <u-icon name="arrow-right" color="#969799" size="28"></u-icon>
      </view>
    </view>

    <view class="m-20">
      <u-cell-group>
        <u-cell
          isLink
          size="large"
          :title="item.title"
          v-for="item in menuList"
          :key="item.id"
          @click="item.handle"></u-cell>
      </u-cell-group>
    </view>
  </view>
</template>

<script setup>
const menuList = ref([
  {
    id: 1,
    title: "地址管理",
    handle: () => uni.$u.route("/pagesA/address/index"),
  },
  {
    id: 2,
    title: "关于我们",
    handle: () => uni.$u.toast("暂未开放"),
  },
  {
    id: 2,
    title: "应用列表",
    handle: () => uni.$u.route("/funpages/funs/index"),
  },
  {
    id: 3,
    title: "退出登录",
    handle: () => {
      uni.$sc.showConfirm("确定退出登录吗？", (confirmRes) => {
        if (confirmRes.confirm) {
          uni.clearStorage({});
          uni.$sc.toast("退出登录成功").then(() => {
            uni.$u.route("/pages/login/index");
          });
        }
      });
    },
  },
]);
</script>
<style>
page {
  background-color: #ededed;
}
</style>
<style lang="scss" scoped>
.camera {
  width: 54px;
  height: 44px;

  &:active {
    background-color: #ededed;
  }
}
.user-box {
  background-color: #fff;
}
.u-cell-group {
  background-color: #fff;
}
</style>
